\NeedsTeXFormat{LaTeX2e}

\ProvidesPackage{enseignement}[09/03/2014]

\DeclareOption*{\PackageWarning{enseignement}{Unknown option `\CurrentOption'}}
\ProcessOptions\relax

\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage[french]{babel}
\RequirePackage[autolanguage]{numprint}
\RequirePackage{geometry}
\RequirePackage{booktabs,multirow,multicol}
\RequirePackage{graphicx}
\RequirePackage{framed}
\frenchbsetup{ThinSpaceInFrenchNumbers,GlobalLayoutFrench}

%%%%%%%%%%%%%%%%
%% general stuff
%%%%%%%%%%%%%%%%
\@ifundefined{rappel}{%
\newlength{\raplength}
\settowidth{\raplength}{Rappel~:\ }
\newcommand{\rappel}[1]{%
\par\noindent%
Rappel~:\ \parbox[t]{\linewidth-\raplength}{\emph{#1}}
}%
}{}
\newlength{\remlength}
\settowidth{\remlength}{Remarque~:\ }
\newenvironment{Remarque}{%
\vspace{1ex plus 0.5ex minus 0.1ex}%
\textsf{\underline{Remarque~:}}\par\nopagebreak[4]%
\vspace{3pt plus 2pt minus 1pt}
}
{\vspace{1ex plus 0.5ex minus 0.1ex}}
\newcommand{\remarque}[1]{%
\par\noindent%
Remarque~:\ \parbox[t]{\linewidth-\remlength-2\parsep}{\sf#1}
\vskip 5pt plus 3pt minus 1pt%
}
%% general defs
\@ifundefined{dd}{\newcommand{\dd}{\ensuremath{\mathrm{d}}}}{}
\@ifundefined{doverd}{\newcommand{\doverd}[2]{\ensuremath{\frac{\dd #1}{\dd #2}}}}{}
\@ifundefined{doverdt}{\newcommand{\doverdt}[1]{\doverd{#1}{t}}}{}
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% TP
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\tpname}{TP}
\newcounter{tp}
\setcounter{tp}{0}
\newcommand{\TP@print@duration}{\TP@duration\gdef\TP@duration{}}
\newcommand{\TPduration}[1]{\gdef\TP@duration{(#1)}}
\gdef\TP@duration{}
\newcommand{\TP}{%
   \clearpage
   \thispagestyle{empty}
   \secdef\@tp\@stp}

\def\@tp[#1]#2{%
    \ifnum \c@secnumdepth >\m@ne
      \refstepcounter{tp}%
      \addcontentsline{toc}{part}{\thetp\hspace{1em}#1}%
    \else
      \addcontentsline{toc}{part}{#1}%
    \fi
    {\parindent \z@ \raggedright
     \interlinepenalty \@M
      \normalfont
        \null\vskip 3cm
       \Huge\bfseries \tpname\nobreakspace\thetp
       \vskip 4ex
     \begin{center}
        \renewcommand{\fboxsep}{20pt}
        \framebox{\parbox{0.8\linewidth}{\Huge \bfseries #2}}%
     \end{center}
     \markboth{}{}\par}%
    \nobreak
    \vskip 3ex
    \begin{center}
    \Large
    \TP@duration
    \end{center}
    \@afterheading
     \clearpage}
\def\@stp#1{%
    {\parindent \z@ \raggedright
     \interlinepenalty \@M
     \begin{center}
        \framebox{\parbox{0.6\linewidth}{\Huge \bfseries #1}}%
     \end{center}\par}%
     \nobreak
     \vskip 3ex
     \begin{center}
      \Large
      \TP@duration
     \end{center}
     \@afterheading
     \clearpage}

%%%%%%%%%%%%%%%%
\newcommand{\AvantDeQuitter}[1]{%
\vspace{1cm}%
\newlength{\box@length}
\newlength{\box@morelength}
\newlength{\box@lesslength}
\setlength{\box@length}{8pt}
\setlength{\box@morelength}{8.4pt}
\setlength{\box@lesslength}{7.6pt}
\newcommand{\box@item}{\raisebox{-1pt}{\rule{0.4pt}{\box@length}\rule{\box@length}{0.4pt}\rule{0.4pt}{\box@length}\hspace{-\box@morelength}\rule[\box@lesslength]{\box@length}{0.4pt}}}
\newcommand{\boxitem}{\item[\box@item]}
\fcolorbox{black}{gray!50}{%
\parbox{0.9\linewidth}{%
\centerline{\MakeUppercase{\Large\bfseries Avant de quitter la salle de TP}}
\par\bigskip
#1}
}
}
%%%%%%%%%%%%%%%%%%%
\newenvironment{materiel}
{%
\newcommand{\matos}[2][1]{\item[##1]{##2}}
\begin{center}
\begin{minipage}{0.5\linewidth}
\begin{framed}
\sf%
\textbf{Matériel mis à la disposition de chaque binôme~:}
\begin{itemize}}
{\end{itemize}
\end{framed}
\end{minipage}
\end{center}
}

\endinput
